package com.u2b.dispatcher;

import java.util.HashMap;

import javax.annotation.PreDestroy;
import javax.servlet.http.HttpServletRequest;


import com.u2b.business.delete.DeleteService;
import com.u2b.global.utils.Constants;

/*
 * else if不能使用变量,所以不得不使用枚举来解决.在1.7中间支持字符串.Java的switch除了内置的原始类型，也支持枚举类型,但是枚举的话必须保证
 * 所有的类型都是final类型,无法做到
 */
public class DeleteDispatcher
{

    private final DeleteService deleteService;

    public DeleteDispatcher()
    {

        deleteService = new DeleteService();

    }

    public Object dispatcer(String action, HashMap<String, Object> initValues, HttpServletRequest request)
    {
        Object obj = null;
 if("status".equals(action)){
	obj= deleteService.deleteStaus(initValues);
 }
        
 else if("activity".equals(action)){
	 obj=deleteService.deleteActivity(initValues);
 }
         
        
        
        
        return obj;
    }

    @PreDestroy
    public void destory()
    {

    }
}
